package im.ok.back.service.impl;

import cn.hutool.core.codec.Morse;
import im.ok.back.common.ServerResponse;
import im.ok.back.service.ITextService;
import org.springframework.stereotype.Service;

@Service
public class TextServiceImpl implements ITextService {

    @Override
    public ServerResponse morseEncode(String originText) {
        return ServerResponse.createSuccessData(new Morse().encode(originText));
    }

    @Override
    public ServerResponse morseDecode(String encodeText) {
        return ServerResponse.createSuccessData(new Morse().decode(encodeText));
    }
}
